Skip to main content

mergGKPostScore

Type

command

Summary

Your game should create the score object and report the score to Game Center immediately after the score is earned

Syntax

mergGKPostScore <pCategory>, <pScore>, [<pSetDefaultLeaderboard>], [<pContext>]

Description

This sets the date and time accurately and ensures that the score is reported correctly. If for some reason the score could not be reported because of a network error, Game Kit automatically resends the data when the network becomes available.

Parameters

NameTypeDescription

pCategory

The leaderboard ID for the leaderboard.

pScore

The score to report.

pSetDefaultLeaderboard

(optional with "false" default) The default leaderboard is set when you create your leaderboards in iTunes Connect. However, the default leaderboard is a per-player setting also; as a player plays your game you can update the default leaderboard shown to that player.

  • true
  • false

pContext

(optional with 0 default) Although the score and formatting system allows you to create interesting leaderboards, you may want to extend the leaderboard system to include other information specific to your game. You do this using score contexts. A score has a context property that holds a 64-bit integer. The value stored in this property is stored along with the score. Game Center doesn’t use this value at all, nor does it affect score formatting. Your game is free to use this integer to store whatever information you want.ulliYou can use the context property to store flags that provide additional content. For example, in a racing game, you might use the flags to store what kind of car the person completed the track with. Then, in your own custom leaderboard user interface, you could display the appropriate car image next to each score./liliYou could record the user’s actions and other data into a file. You then design your game engine to be able to replay the contents of that file. You store the file on your own server and use the context field as an index to reference the file. Your custom leaderboard user interface can then offer the ability to see exactly how someone earned the score./liliYou could implement the replay directly into your gameplay. For example, in the hypothetical racing game, you use a player’s replay file to display a phantom car for the current player to race against./li/ul

Compatibility and Support

Introduced

LiveCode 8.0

OS

ios

Platforms

mobile

Thank you for your feedback!

Was this page helpful?